package com.baizhi.reflect;

public class Student extends Person implements Swim{

    private String name;
    private int age;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println("公共的方法");
    }

    private void speak(){
        System.out.println("这是私有方法");
    }

    protected  void study(){
        System.out.println("这是受保护的方法");
    }

    @Override
    public void swiming() {
        System.out.println("重写接口中的方法");
    }
}
